package com.dd.common.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.*;

@Data
@Schema(name = "上传文件DTO")
public class FileUploadDTO {

    @Schema(description = "上传的文件，字段为 file", format = "binary")
    @NotNull(message = "文件不能为空")
    private MultipartFile file;

    @Schema(description = "文件哈希值", example = "a95f788b-6372-413e-88f0-b41556df2c2d")
    @NotBlank(message = "文件哈希值不能为空")
//    @Pattern(regexp = "^[a-fA-F0-9]{32}$", message = "哈希值必须是有效的32位MD5")
    private String hash;

    @Min(value = 1, message = "目录ID必须大于0")
    private Long dirId;
    @Min(value = 1, message = "业务ID必须大于0")
    private Long bizId;
}
